package c;
//p200 HashSet集合类应用
import java.util.HashSet;

public class demo2 {
    public static void main(String[] args) {
        HashSet <Goods> hs = new HashSet<Goods>();
        hs.add(new Goods("C001","扫把","好媳妇",20,3.59));
        hs.add(new Goods("D002","拖把","好媳妇",20,63.23));
        hs.add(new Goods("C001","扫把","好媳妇",20,3.59));
        System.out.println("HashSet 集合中的元素有：");
        for(Goods g : hs){
            System.out.println(g.getId() + "\t" + g.getName() + "\t" + g.getBrand() + "\t" + g.getCount() + "\t" + g.getPrice());
        }
    }
}
